﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using l1cs.server.model.Instance;

namespace l1cs.server.model
{
    public class MpRegenerationByDoll
    {
        private static Logger _log = Logger.getLogger( typeof( MpRegenerationByDoll ).FullName );

        private L1PcInstance _pc;

        public MpRegenerationByDoll( L1PcInstance pc )
        {
            _pc = pc;
        }

        // 特別 TODO
        public void cancel() { }

        public void run(object state)
        {
            if ( _pc.isDead() )
            {
                return;
            }
            regenMp();
        }

        public void regenMp()
        {
            int newMp = _pc.getCurrentMp() + 15;
            if ( newMp < 0 )
            {
                newMp = 0;
            }
            _pc.setCurrentMp( newMp );
        }
    }
}
